#!/bin/bash

make config PLAT=ios ARCH=$4 DEBUG=$2 SDK=$3
make clean; make ; make install; make prefix

make config PLAT=ios ARCH=$5 DEBUG=$2 SDK=$3
make clean; make ; make install; make prefix 

rm -rf ./bin/ios/arm/inc
rm -rf ./bin/ios/arm/lib
mkdir -p ./bin/ios/arm/lib
mkdir -p ./bin/ios/arm/inc

cp -r ./bin/ios/$5/inc/$1 ./bin/ios/arm/inc/
xcrun -sdk iphoneos lipo -create -arch $4 ./bin/ios/$4/lib/lib$1.a -arch $5 ./bin/ios/$5/lib/lib$1.a -output ./bin/ios/arm/lib/lib$1.a
make prefix ARCH=arm


